{extend name="../../admin/view/main"}
{block name='button'}
<!--{if auth("add_app")}-->
<button data-modal='{:url("add_app")}' data-title="添加应用目录" class='layui-btn layui-btn-sm layui-btn-primary'>添加新应用</button>
<!--{/if}-->

{/block}
{block name='content'}
<div class="think-box-shadow table-block">
    <div class="layui-row">
        <div class="layui-col-md2 padding-5">
            <div class="layui-panel">
                <blockquote class="layui-elem-quote">应用列表</blockquote>
                <ul class="layui-menu">
                    {notempty name='apps'}
                    {foreach $apps as $v}
                    <li  data-open="{:url()}?app={$v}" {if input('app') == $v} class="layui-menu-item-checked"{/if}><i class="layui-icon layui-icon-right"></i>{$v}</li>
                    {/foreach}
                    {/notempty}
                </ul>
            </div>
        </div>
        <div class="layui-col-md10 padding-5">
            {notempty name='apps'}
            {if input('app')}
            <button class="layui-btn layui-btn-sm" data-modal="{:url('add')}?app={:input('app')}">添加控制器</button>

            <table class="layui-table" id='table'>
                <thead>
                    <tr>
                        <th class='list-table-check-td think-checkbox'> <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label></th>
                        <th class="text-left nowrap">控制器名</th>
                        <th class="text-left nowrap">控制器名称</th>
                        <th class="text-left nowrap">编辑</th>
                        <th class="text-left nowrap">删除</th>
                        <th class="text-center nowrap" >数据操作</th>
                        <th class="text-center" >代码生成</th>
                    </tr> 
                </thead>
                <tbody>
                    {foreach $list as $key=>$vo}
                    <tr>
                        <td class="list-table-check-td think-checkbox"><label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label></td>
                        <td>{$vo.name}</td>
                        <td>{$vo.title}</td>
                        <td>{eq name='vo.edit' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">已激活</span>{/eq}</td>
                        <td>{eq name='vo.del' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">已激活</span>{/eq}</td>
                        <td class="text-center">
                            <!--{if auth("edit")}-->
                            <a class="layui-btn layui-btn-sm" data-dbclick data-modal="{:url('edit')}?app={:input('app')}&id={$vo.id}">编 辑</a>
                            <!--{/if}-->
                            <!--{if auth("remove")}-->
                            <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除控制器吗？" data-value="id#{$vo.id};app#{$vo.app};name#{$vo.name}">删 除</a>
                            <!--{/if}-->
                         
                            <a class="layui-btn layui-btn-sm layui-btn-primary"  data-iframe="{:url('auto/field/index')}?table_id={$vo.id}" data-title="{$vo.title}控制器- 字段管理">字段管理</a>
                            
                        </td>
                        <td class="text-center">
                            
                            <button type="button" class="layui-btn layui-btn-sm  layui-btn-normal" data-action="{:url('build')}" data-value="id#{$vo.id}" >一键生成</button>
                        </td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
            {/if}
            {/notempty}
        </div>
    </div>



</div>

<!-- 自定义脚本区，也可能放 content 中，局部加载限制少-->
<script>

</script>
{/block}
